<template>
	<view>
		添加页面
		<table>
			<tr>
				<td>采购商姓名</td>
				<td><input type="text" v-model="Name" style="background-color: antiquewhite;"></td>
			</tr>
			<tr>
				<td>采购商手机号</td>
				<td><input type="text" v-model="Tel" style="background-color: antiquewhite;"></td>
			</tr>
			<tr>
				<td>申请时间</td>
				<td><input type="text" v-model="SqTime" style="background-color: antiquewhite;"></td>
			</tr>
			<tr>
				<td>采购商等级</td>
				<td><input type="text" v-model="ShopDj" style="background-color: antiquewhite;"></td>
			</tr>
			<tr>
				<td>企业类型</td>
				<td><input type="text" v-model="ShopType" style="background-color: antiquewhite;"></td>
			</tr>
			<tr>
				<td>其他信息</td>
				<td><input type="text" v-model="QtXx" style="background-color: antiquewhite;"></td>
			</tr>
			<button type="submit" @click="add()">添加</button>
		</table>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				Name: "",
				Tel: "",
				SqTime: "",
				ShopDj: "",
				ShopType: "",
				QtXx: "",
			}
		},
		methods: {
			add() {
				uni.request({
					url: 'http://127.0.0.1:8080/add', //仅为示例，并非真实接口地址。
					data: {
						Name: this.Name,
						Tel: this.Tel,
						SqTime: this.SqTime,
						ShopDj: this.ShopDj,
						ShopType: this.ShopType,
						QtXx: this.QtXx,
					},
					method:"POST",
					header: {
						'content-type': 'application/x-www-form-urlencoded' //自定义请求头信息
					},
					success: (res) => {
						console.log(res.data)
						if (res.data.Cre==200) {
							alert("添加成功")
						uni.navigateTo({
							url:"/pages/index/index"
						})
						}

					}
				});
			},
		}
	}
</script>

<style>

</style>